const { wxRequest,hzDataRequest } = require('./wxRequest')
//const { hzDataRequest } = require('./wxRequest')
const apiMall = 'https://ddapp.zjwhhly.com/wxrequest/zlhw.ashx?m='

/* 
* 整体接口管理
*/

/* --------------登录界面----------- */
//通过code获取openid 和 unionid("JSCODE":code)
const getOpenId = (params) => wxRequest('POST', apiMall + 'code2Session', params);
//微信用户新增和修改
const setWxUserInfo = (params) => wxRequest('POST', apiMall + 'wxuserinfochange', params);

/* --------------首页界面----------- */
//首页加载数据( "loadPage":"0","tab":"酒店", "nowPage":"1")
const getHomeInfo = (params) => wxRequest('POST', apiMall + 'getindexinfobypageload_weixin', params);
//跳转外链
const setOutLink = (params) => wxRequest('POST', apiMall + 'newsview', params);
//热门资讯
const getHotNews = (params) => wxRequest('POST', apiMall + 'rmzx', params);
//判断登录
const getIsLogin = (params) => wxRequest('POST', apiMall + 'userneedlogin721', params);
//获取userId(补丁)
const getUserId = (params) => wxRequest('POST', apiMall + 'getuseridbyopenid', params);

/* --------------我的界面----------- */
//我的订单
const getMyOrder = (params) => wxRequest('POST', apiMall + 'userorderinfo', params);

/* --------------服务界面----------- */
//获取气象信息
const getWeather = (params) => wxRequest('POST', apiMall + 'warnlist', params);
//获取景区天气
const getScWeather = (params) => wxRequest('POST', apiMall + 'weatherlist', params);
//企业信用查询
const getCredit = (params) => wxRequest('POST', apiMall + 'ggxy', params);

/* --------------预约预定界面----------- */
//获取预约预定列表
const getReserveList = (params) => wxRequest('POST', apiMall + 'yyyd', params);

/* --------------二维码扫描----------- */
const getNewsInfoById = (params) => wxRequest('POST', apiMall + 'getnewsinfobyid', params);

/* --------------日历----------- */
const getCalendar = (params) => wxRequest('POST',apiMall + 'wlrlnewslist',params);
const getCalendarDetails = (params) => wxRequest('POST',apiMall + 'wlrlinfo',params);
const getCalendarMonth = (params) => wxRequest('POST',apiMall+'wlrlnewslistmonthall',params);
const getCalendarHangZhou = (params) => wxRequest('POST',apiMall+'hzrl',params);
/* const getCalendarHangZhou = (params) => hzDataRequest('GET','https://hzcalendar.dskb.cn/api/v1/activities/'+params,[],{  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJoemNhbC5kc2tiLmNuIiwic3ViIjoiZWU0MWZiOGItMjhjOS00NDk5LWFkYjUtNzBjZmJhOTgwZGQzIiwiYXVkIjpbImNuLmdvdi56ai5jdCJdLCJpYXQiOjE2MjI2ODQ1MTc0OTJ9.-L6rmB9sg1N4z1gkYNJhmZwcZ6MkyHY7XRcpRPscxTg","Content-Type": "application/text" }) */
module.exports = {
  getOpenId,
  setWxUserInfo,
  getHomeInfo,
  setOutLink,
  getMyOrder,
  getWeather,
  getScWeather,
  getReserveList,
  getHotNews,
  getCredit,
  getIsLogin,
  getNewsInfoById,
  getUserId,
  getCalendar,
  getCalendarDetails,
  getCalendarMonth,
  getCalendarHangZhou
}